// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

@import AVFoundation;
@import Foundation;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - flash mode

/**
 * Represents camera's flash mode. Mirrors `FlashMode` enum in flash_mode.dart.
 */
typedef NS_ENUM(NSInteger, OcrFlashMode) {
  OcrFlashModeOff,
  OcrFlashModeAuto,
  OcrFlashModeAlways,
  OcrFlashModeTorch,
};

/**
 * Gets OcrFlashMode from its string representation.
 * @param mode a string representation of the OcrFlashMode.
 */
extern OcrFlashMode OcrGetOcrFlashModeForString(NSString *mode);

/**
 * Gets AVCaptureFlashMode from OcrFlashMode.
 * @param mode flash mode.
 */
extern AVCaptureFlashMode OcrGetAVCaptureFlashModeForOcrFlashMode(OcrFlashMode mode);

#pragma mark - exposure mode

/**
 * Represents camera's exposure mode. Mirrors ExposureMode in camera.dart.
 */
typedef NS_ENUM(NSInteger, OcrExposureMode) {
  OcrExposureModeAuto,
  OcrExposureModeLocked,
};

/**
 * Gets a string representation of exposure mode.
 * @param mode exposure mode
 */
extern NSString *OcrGetStringForOcrExposureMode(OcrExposureMode mode);

/**
 * Gets OcrExposureMode from its string representation.
 * @param mode a string representation of the OcrExposureMode.
 */
extern OcrExposureMode OcrGetOcrExposureModeForString(NSString *mode);

#pragma mark - focus mode

/**
 * Represents camera's focus mode. Mirrors FocusMode in camera.dart.
 */
typedef NS_ENUM(NSInteger, OcrFocusMode) {
  OcrFocusModeAuto,
  OcrFocusModeLocked,
};

/**
 * Gets a string representation from OcrFocusMode.
 * @param mode focus mode
 */
extern NSString *OcrGetStringForOcrFocusMode(OcrFocusMode mode);

/**
 * Gets OcrFocusMode from its string representation.
 * @param mode a string representation of focus mode.
 */
extern OcrFocusMode OcrGetOcrFocusModeForString(NSString *mode);

#pragma mark - device orientation

/**
 * Gets UIDeviceOrientation from its string representation.
 */
extern UIDeviceOrientation OcrGetUIDeviceOrientationForString(NSString *orientation);

/**
 * Gets a string representation of UIDeviceOrientation.
 */
extern NSString *OcrGetStringForUIDeviceOrientation(UIDeviceOrientation orientation);

#pragma mark - resolution preset

/**
 * Represents camera's resolution present. Mirrors ResolutionPreset in camera.dart.
 */
typedef NS_ENUM(NSInteger, OcrResolutionPreset) {
  OcrResolutionPresetVeryLow,
  OcrResolutionPresetLow,
  OcrResolutionPresetMedium,
  OcrResolutionPresetHigh,
  OcrResolutionPresetVeryHigh,
  OcrResolutionPresetUltraHigh,
  OcrResolutionPresetMax,
};

/**
 * Gets OcrResolutionPreset from its string representation.
 * @param preset a string representation of OcrResolutionPreset.
 */
extern OcrResolutionPreset OcrGetOcrResolutionPresetForString(NSString *preset);

#pragma mark - video format

/**
 * Gets VideoFormat from its string representation.
 */
extern OSType OcrGetVideoFormatFromString(NSString *videoFormatString);

NS_ASSUME_NONNULL_END
